@extends('layout.admin')

@section('title','商品修改')

@section('content')
<div class="row">

    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
        <div class="widget am-cf">
            <div class="widget-head am-cf">
                <div class="widget-title am-fl">商品修改</div>
                
            </div>
            <div class="widget-body am-fr">
                
                <form class="am-form tpl-form-border-form tpl-form-border-br" action="/good/update" method="post" enctype="multipart/form-data">
                    @if (count($errors) > 0)
                    <div class="am-form-message error">
                        <ul>
                            @foreach ($errors->all() as $error)
                                <li>{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                    @endif
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">店铺id</label>
                        <div class="am-u-sm-9">
                            <input type="text" class="tpl-form-input" id="user-name" value="{{session('pid')}}" name="sid" readonly>
                            
                        </div>
                    </div>

                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">商品名称</label>
                        <div class="am-u-sm-9">
                            <input type="text" class="tpl-form-input" id="user-name" name="goodsname" value="{{$good->goodsname}}">
                            
                        </div>
                    </div>

                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">商品分类</label>
                        <div class="am-u-sm-9">
                            <select name="stid">
                            <!-- <option value="{{$good->typename}}">{{$good->typename}}</option> -->
                            @foreach($data as $v)   
                                <option value="{{$v->id}}">{{$v->typename}}</option>
                            @endforeach
                            </select>
                        </div>
                    </div>                                    

                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">商品价格</label>
                        <div class="am-u-sm-9">
                            <input type="text" class="tpl-form-input" id="user-name" value="{{$good->price}}" name="price">
                            
                        </div>
                    </div>

					<div class="am-form-group">
                        <label for="user-intro" class="am-u-sm-3 am-form-label">商品简介</label>
                        <div class="am-u-sm-9">
                            <textarea class="" rows="10" name="describe" id="user-intro" placeholder="请输入文章内容">{{$good->describe}}</textarea>
                        </div>
                    </div>


                    <div class="am-form-group">
                        <label for="user-weibo" class="am-u-sm-3 am-form-label">商品图片</label>
                        <img src="{{$good->logo}}" style="width:50px;float:left" alt="">
                        <input type="file" name="img">
                    </div>

                    <div class="am-form-group">
                        <div class="am-u-sm-9 am-u-sm-push-3">
                            {{csrf_field()}}
                            <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                            <input type="hidden" name="id" value="{{$good->id}}">
                            <input type="reset" class="am-btn am-btn-danger tpl-btn-bg-color-danger " value="重置">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

@endsection

